<template>
    <div>{{msg}}</div>
    <div class="mui-content carInfo">
        <!--车辆信息-->
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right text2">汽车品牌
                    <span class="mui-pull-right color2 mgr1" id="carBrandValue">别克通用2.0T</span>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="text2">车牌号<span class="mui-pull-right color2 mgr1">苏BD6669</span></a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right text2">购买价格
                    <span class="mui-pull-right color2 mgr1">15-20万</span>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="text2 mui-navigate-right" id="buyTime">购买时间
                    <span class="mui-pull-right color2 mgr1" id="buyTimeValue" data-options='{"type":"date","endYear":2016}'  @click="datePicker()">2016-09-01</span>
                </a>
            </li>
        </ul>
    </div>
</template>
<style>
</style>
<script type="text/ecmascript-6">
		import '../../fonts/mui.css';
        import datePickerComponent from '../../components/date-picker/date-picker.vue';
        export default {
            data(){
                return{
                }
            },
            ready () {
                mui.init();
            },
            components:{
                datePickerComponent
            },
            methods: {
                datePicker: function () {
                    (function ($) {
                        $.init();
                        var buyTimeValue = document.getElementById('buyTimeValue')
                        buyTimeValue.addEventListener('tap', function () {
                            var optionsJson = this.getAttribute('data-options') || '{}';
                            var options = JSON.parse(optionsJson);
                            var id = this.getAttribute('id');
                            var picker = new $.DtPicker(options);
                            picker.show(function (rs) {
                                buyTimeValue.innerText = rs.text;
                                picker.dispose();
                            });
                        }, false);
                    })(mui);
                },
            }
    };
</script>

